import { ProjectSetting } from '@/setting';
import { App } from 'vue';
import { createRouter, createWebHashHistory, createWebHistory, RouteRecordRaw } from 'vue-router';
import { basicRoutes } from './routes';

export const router = createRouter({
	history: ProjectSetting.routeMode === 'HASH' ? createWebHashHistory() : createWebHistory(ProjectSetting.resourceBaseUrl),
	routes: basicRoutes as RouteRecordRaw[],
});
export function setupRouter(app: App<Element>) {
	app.use(router);
}
